<?php if (sizeof($products) > 0) { ?>
    <div id="category_pro">
        <?php if ($products) { ?>
            <div id="review_title"></div>
            <div class="pagination"><?php echo $pagination; ?></div>
            <div id="category_product_suggestion" name="product_suggestion">
            <ul>
                <?php for ($i = 0; $i < sizeof($products); $i++) { ?>
                    <li class="category_bg_grays">
                        <div class="category_image-view"> <!--Hinh anh san pham-->
                            <a href="<?php echo $products[$i]['href']; ?>">
                                <img width="80px" hight="80px" src="<?php echo $products[$i]['thumb']; ?>" alt="<?php echo $products[$i]['name']; ?>"/>
                            </a>
                        </div>
                        <h1 class="pro_name"> <!--Tieu de san pham-->
                            <a href="<?php echo $products[$i]['href']; ?>">
                                <!-- Chen tieu de sp -->
                                <?php echo $products[$i]['name']; ?>
                            </a>
                        </h1>
                        <p class="pro_value">
                            <?php if ($display_price) { ?>
                                Giá:
                                <?php if (!$products[$i]['special']) { ?>
                                    <span class="pro_price"> <?php echo $products[$i]['price']; ?></span>
                                <?php } else { ?>
                                    <span class="pro_price"> <?php echo $products[$i]['price']; ?></span> <?php echo $products[$i]['special']; ?>
                                <?php } ?>
                            <?php } ?>
                        </p>
                        <p class="pro_place">
                            Bán bởi 
                            <?php if (isset($products[$i]['shop_name'])) { ?>
                                <span class="pro_user"> <?php echo $products[$i]['shop_name'] ?></span>
                            <?php } ?> tại <span class="pro_place"><?php echo $products[$i]['zone']; ?></span>
                        </p>
                    </li>
                <?php } ?>  
            </ul>
            </div>
            <div class="pagination"><?php echo $pagination; ?></div>
        <?php } ?>
    </div>

<?php } else { ?>
    <div style="clear: both; height:23px;background-color: #DDDFFF">
        Không tìm thấy sản phẩm.
    </div>
<?php } ?>
<script type="text/javascript">
    function getCatalogData(url) {
        $.ajax({
            type: 'post',
            url: url,
            dataType: 'json',
            beforeSend: function() {

                $('#review_title').after('<div style="width:740px; text-align: center;" class="wait">Hệ thống đang xử lý...<img src="catalog/view/theme/default/image/loading_1.gif" alt="" /></div>');
            },
            complete: function() {
            },
            success: function(data) {
                if (data.error) {
                    $('#review_title').after('<div class="warning">' + data.error + '</div>');
                }
                if (data.success) {
                    //$("#content").html("");
                    $("#content").html(data.html);
                }
            }
        });
    }

</script>